Attribute VB_Name = "logManager"
Option Explicit

Public Const dbgWnd As Integer = 2
Public Const dbgLog As Integer = 1
Public Const dbgNon As Integer = 0
Public dbgMode As Integer
Private lastLogLine As String


Public Function logMan(MsgTag As String, ByVal lStr As String)
Dim logStr As String

If InStr(1, lStr, "BW") > 0 Then lStr = ""
If Left$(lStr, InStr(1, lStr, " ")) = "GETINFO " And lastLogLine = "GETINFO " Then lStr = ""

If lStr <> "" And Not (dbgMode = dbgNon) Then
    logStr = "[" + CStr(Timer) + "]" + MsgTag + "=" + lStr
    Select Case dbgMode
        Case dbgLog
            On Error Resume Next
            Write #9, logStr
        Case dbgWnd
            Debug.Print logStr
    End Select
lastLogLine = Left$(lStr, InStr(1, lStr, " "))
End If
End Function
